package com.lans.HuffmanTree;

/**
 * @author: lans
 * @date: 2025/3/3
 * @name: 刘宇
 */
public class Node implements Comparable<Node>{

    //权值
    public int value;

    //左节点
    public Node left;

    //右节点
    public Node right;

    public Node(int value) {
        this.value = value;
    }

    //比较大小
    @Override
    public int compareTo(Node o) {
        return this.value-o.value;
    }

    @Override
    public String toString() {
        return "Node{" +
                "value=" + value +
                ", left=" + left +
                ", right=" + right +
                '}';
    }
}